import { combineReducers } from 'redux'

function getMessage(state = {}, action) {
    // console.log(state)
    switch(action.type) {
        case 'GET_MESSAGE':
            return {
                ...state,
                message: action.data
            }
        default:
            return state
    }
}

function updateDetail(state = {}, action) {
    // console.log(state)
    switch(action.type) {
        case 'UPDATE_DETAIL':
            console.log({
                ...state,
                detail: action.data
            })
            return {
                ...state,
                detail: action.datax
            }
        default:
            return state
    }
}


const reducers = combineReducers({
    getMessage,
    updateDetail
})

export default reducers
